package pl.javarsovia.javarsovia4android.menu.commands;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import pl.javarsovia.R;
import pl.javarsovia.javarsovia4android.menu.ButtonCommand;

/**
 * @author mateusz.grzechocinski@gmail.com
 * @since 2010-06-06
 */
public class MapsButtonCommand implements ButtonCommand {

    private static final double CONFERENCE_LATITUDE = 0;
    private static final double CONFERENCE_LONGITUDE = 0;
    private static final String CONFERENCE_ADDRESS = "warsaw+bobrowiecka+9";

    private Activity activity;

    public MapsButtonCommand(Activity activity) {
        this.activity = activity;
    }

    @Override
    public void buttonClicked() {
        String uri = "geo:" + CONFERENCE_LATITUDE + "," + CONFERENCE_LONGITUDE + "?q=" + CONFERENCE_ADDRESS;
        activity.startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));
    }

    @Override
    public int getButtonResId() {
        return R.id.button_menu_maps;
    }
}
